<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get an affine transformation matrix</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.imageaffinematrixconcat.html">« imageaffinematrixconcat</a></li>
      <li style="float: right;"><a href="function.imagealphablending.html">imagealphablending »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.image.html">GD 和图像处理 函数</a></li>
    <li>Get an affine transformation matrix</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.imageaffinematrixget" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imageaffinematrixget</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.5.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imageaffinematrixget</span> &mdash; <span class="dc-title">Get an affine transformation matrix</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.imageaffinematrixget-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imageaffinematrixget</strong></span>(<span class="methodparam"><span class="type">int</span> <code class="parameter">$type</code></span>, <span class="methodparam"><span class="type"><span class="type">array</span>|<span class="type">float</span></span> <code class="parameter">$options</code></span>): <span class="type"><span class="type">array</span>|<span class="type"><span class="type false">false</span></span></span></div>

  <p class="para rdfs-comment">
   Returns an affine transformation matrix.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.imageaffinematrixget-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">type</code></dt>

    <dd>

     <p class="para">
      One of the <strong><code>IMG_AFFINE_*</code></strong> constants.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">options</code></dt>

    <dd>

     <p class="para">
      If <code class="parameter">type</code> is <strong><code>IMG_AFFINE_TRANSLATE</code></strong>
      or <strong><code>IMG_AFFINE_SCALE</code></strong>,
      <code class="parameter">options</code> has to be an <span class="type">array</span> with keys <code class="literal">x</code>
      and <code class="literal">y</code>, both having <span class="type">float</span> values.
     </p>
     <p class="para">
      If <code class="parameter">type</code> is <strong><code>IMG_AFFINE_ROTATE</code></strong>,
      <strong><code>IMG_AFFINE_SHEAR_HORIZONTAL</code></strong> or <strong><code>IMG_AFFINE_SHEAR_VERTICAL</code></strong>,
      <code class="parameter">options</code> has to be a <span class="type">float</span> specifying the angle.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.imageaffinematrixget-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   An affine transformation matrix (an array with keys
   <code class="literal">0</code> to <code class="literal">5</code> and float values)
    或者在失败时返回 <strong><code>false</code></strong>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.imageaffinematrixget-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2625">
    <p><strong>示例 #1 <span class="function"><strong>imageaffinematrixget()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$matrix&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imageaffinematrixget</span><span style="color: #007700">(</span><span style="color: #0000BB">IMG_AFFINE_TRANSLATE</span><span style="color: #007700">,&nbsp;array(</span><span style="color: #DD0000">'x'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">2</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'y'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">3</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$matrix</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Array
(
    [0] =&gt; 1
    [1] =&gt; 0
    [2] =&gt; 0
    [3] =&gt; 1
    [4] =&gt; 2
    [5] =&gt; 3
)
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.imageaffinematrixget-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member"><span class="function"><a href="function.imageaffine.html" class="function" rel="rdfs-seeAlso">imageaffine()</a> - 返回经过仿射变换后的图像，剪切区域可选</span></li>
   <li class="member"><span class="function"><a href="function.imageaffinematrixconcat.html" class="function" rel="rdfs-seeAlso">imageaffinematrixconcat()</a> - Concatenate two affine transformation matrices</span></li>
  </ul>
 </div>


</div></div></div></body></html>